type getRoomType = {
  page?: number;
  pageSize?: number;
  b_id?: number;
  floor?: number;
  status?: string;
  room_type_id?: number;
};
import request from '@/utils/request';


export const getRoomList = (params: getRoomType) => request({
  url: '/admin/rooms/list',
  params
});
export const GetcardNow = (data: number) =>  request({
  url: `/admin/hour/card/now/${data}`,

});
interface GetTK {
  page: string
  pageSize: string
}
// 获取梯控
export const GetTK = (params: GetTK) => request({
  url: `/admin/setcardLadderControl/list?page=${params.page}&pageSize=${params.pageSize}`,
});
interface ADDTK {
  id?: number
  bid: string
  roomId: string,
  bname: string,
  startFloor: string,
  publicFloor: string,
  pulicFloorId: string,
  remark: string,
  permissions: string
}
// 新增梯控 
export const ADDTK = (data: ADDTK) => request({
  method: "POST",
  url: "/admin/setcardLadderControl/edit",
  data
});
// 删除梯控 
export const DelTK = (id: number) => request({
  method: "POST",
  url: "/admin/setcardLadderControl/delete",
  data: { id }
});
// 获取通道
export const SetCorridor = (params: GetTK) => request({
  url: `/admin/setcardCorridor/list?page=${params.page}&pageSize=${params.pageSize}`,
});
interface ADDTD {
  id?: number
  roomId: string,
  bname: string,
  roomName: string,
  publicFloor?: string,
  floor: string,

}
// 新增通道
export const ADDCorridor = (data: ADDTD) => request({
  method: "POST",
  url: "/admin/setcardCorridor/edit",
  data
});
// 删除通道
export const DELCorridor = (id: string) => request({
  method: "POST",
  url: "/admin/setcardCorridor/delete",
  data: { id }
});

// 获取楼栋信息
export const getBuildingsList = () =>
  request({
    url: '/admin/buildings/list'
  });

//新增设置卡记录  

export const AddlogSetupCard = (data: AddlogSetupCard) =>
  request({
    method: "POST",
    url: '/admin/logSetupCard/add',
    data
  });



// 新增通道发卡记录
export const AddlogCorridor = (data: any) =>{
 
  request({
    method: "POST",
    url: '/admin/logCorridor/add',
    data
  });
}

// 新增梯控发卡记录
export const AddlogLadderControl= (data: any) =>{
 
  request({
    method: "POST",
    url: '/admin/logLadderControl/add',
    data
  });
}


interface AddlogSetupCard{
  roomId:string
  roomNo:string
  roomName:string
  cardNum:string
  issuingTime:string
  cardType:string
  isTimeoutAlarm:string
  isFalseLockAlarm:string
  cmdInfo:string

}















